package design.simdi.code.final_paper.site.pages;

import org.apache.wicket.RedirectToUrlException;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.markup.html.AjaxFallbackLink;
import org.apache.wicket.markup.html.panel.EmptyPanel;

/**
 * 
 * @author Marius Dumitriu - (Jun 27, 2010 - 1:41:35 AM)
 * 
 */
public class MyErrorPage extends BasePage {

	public MyErrorPage(Exception e) {
		get("link.login").setVisible(false);
		get("link.register").setVisible(false);
		get("menu").replaceWith(new EmptyPanel("menu"));
		add(new AjaxFallbackLink<String>("home") {

			private static final long serialVersionUID = 1L;

			@Override
			public void onClick(AjaxRequestTarget target) {
				throw new RedirectToUrlException("/home");

			}
		});
	}

	@Override
	public boolean isVersioned() {
		return false;
	}

	@Override
	public boolean isErrorPage() {
		return true;
	}

}
